package com.hpf.gupao.thread;

/**
 * @description:
 * @datetime: 2021/5/15 20:53
 * @author: huangpengfei
 */
public class ThreadDemo extends Thread {

    @Override
    public void run() {
        try {
            System.out.println("i go to sleep");
            Thread.sleep(1000);
            System.out.println("sleep end");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("Thread end");
    }

    public static void main(String[] args) throws InterruptedException {
        new ThreadDemo().start();
        Thread.sleep(2000);
        System.out.println("The main thread end");
    }
}
